package com.example.demo.repository;

import com.example.demo.model.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface StudentRepository extends JpaRepository<Student,Long> {

    List<Student> findByName(String name);

    @Query(value = "select * from student where name = ?1 and age = ?2", nativeQuery = true)
    List<Student> findByNameOrAge(String name, String age);
}
